#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

int main()
{
    int x, i;
    scanf("%d %d", &x, &i);
    int j = 0;
    int sub = 1;

    for (j = 0; j < i; j++)
    {
        sub *= 10;
    }
    printf("%d", x % sub);
    return 0;
}

#include<stdio.h>

int H(int n, int x)
{
    if (n <= 1)
    {
        return n + 1;
    }
    else
    {
        return 2 * x * H(n - 1, x) - 2 * (n - 1) * H(n - 2, x);
    }
}

int main()
{
    int n, x;
    scanf("%d %d", &n, &x);
    printf("%d", H(n, x));
    return 0;
}

#include<stdio.h>

void Print(int x)
{
    if (x <= 9)
    {
        printf("%d", x);
    }
    else
    {
        printf("%d", x % 10);
        Print(x / 10);
    }
}

int main()
{
    int n = 0;
    scanf("%d", &n);
    Print(n);
    return 0;
}

#include<stdio.h>

int max3(int a, int b, int c)
{
    int max = a;
    if (b > max)
    {
        max = b;
    }
    if (c > max)
    {
        max = c;
    }
    return max;
}

int main()
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    printf("%.2lf", max3(a + b, b, c) * 1.0 / (max3(a, b + c, c) + max3(a, b, b + c)));
    return 0;
}

#include<stdio.h>

int Is_five(int x)
{
    int sum = 0;
    while (x)
    {
        sum += x % 10;
        x /= 10;
    }
    if (sum % 5 == 0)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    int i = 0;
    int sum = 0;

    for (i = a; i <= b; i++)
    {
        sum += Is_five(i);
    }
    printf("%d", sum);
    return 0;
}